package com.lv.fast.model;

import com.baomidou.mybatisplus.annotation.TableId;
import com.lv.fast.valid.group.AddStrategy;
import com.lv.fast.valid.group.UpdateStrategy;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Null;
import java.time.LocalDateTime;

/**
 * @Description
 * @Author jie.lv
 */
@Data
@Validated
public class BaseBean {

    @TableId
    @ApiModelProperty(value = "id",example = "1399194989481791490")
    @NotBlank(message = "id不能为空", groups = {UpdateStrategy.class})
    @Null(message = "不能设置id", groups = {AddStrategy.class})
    private String id;

    @ApiModelProperty(value = "创建时间",example = "2021-05-21 10:00:00")
    @Null(message = "不能设置创建时间")
    private LocalDateTime createdTime;

    @ApiModelProperty(value = "修改时间",example = "2021-05-21 10:00:00")
    @Null(message = "不能设置修改时间")
    private LocalDateTime updatedTime;
}
